<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <title>未提款订单 - 租房宝金融管理平台</title>
  
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">

    <%@ include file="/WEB-INF/include/aside.jsp"%>
    <div class="content">
      <header class="header clearfix">
          <h3 class="pull-left">未提款订单列表</h3>
       </header>
        <c:if test="${not empty infoMessage}">
             <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
               <button type="button" class="close" data-dismiss="alert">&times;</button>
               <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
               <fmt:message key="${infoMessage}" />
             </div>
        </c:if>       
         <form method="GET" action="${ctx}/flow/unpayout/search"> 
         <input type="hidden" name="filter" value="true" >
         <div class="row">
                          
           <div class="col-xs-4">
             
             <div class="input-group pull-left">
               <span class="input-group-addon" id="basic-addon1">订单号</span>
               <input type="text" class="form-control" name="orderNo" value="${orderNo}" placeholder="输入订单号" aria-describedby="basic-addon1">
             </div>

           </div>
           
           <div class="col-xs-2">
             <div class="btn-group pull-right">
               <button class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" ><i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;查询</button>
             </div>
           
           </div>

         </div>

         </form>

         <div class="table-area">
         <table class="data-list">
              <thead>
                <tr>
                  <th>订单号</th>
                  <th>租约号</th>
                  <th>房东</th>
                  <th>付款人</th>
                  <th>收款银行</th>
                  <th>收款账号</th>
                  <th>订单金额</th>
                  <th>订单状态</th>
                </tr>
              </thead>
              <tbody>
                <c:forEach var="order" items="${orderList}">
                  <tr>
                    <td>${order.orderNo}</td>
                    <td>${order.contract.contractNo}</td>
                    <td>${order.customer.app.name}</td>
                    <td>${order.customer.name}</td>
                    <td>${not empty data.getFactoringContract(order.contract.contractNo) ? data.getFactoringContract(order.contract.contractNo).company.bankName : order.contract.app.payeeBankName}</td>
                    <td>${not empty data.getFactoringContract(order.contract.contractNo) ? data.getFactoringContract(order.contract.contractNo).company.cardNo : order.contract.app.payeeAccountNo}</td>                    
                    <td>&yen;&nbsp;${order.totalRent}</td>
                    <td><fmt:message key="${order.orderStatus.key}" /></td>
                  </tr>
                </c:forEach>
              </tbody>
          </table>
          <div class="col-xs-4">                  
            <div class="btn-group ">
              <p>合计：${total}</p>
            </div>                
          </div> 
          <div class="col-xs-4">                  
            <div class="btn-group pull-right">
              <a id="print" href="javascript:void(0)" target="_blank" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" ><i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;打印预览</a>
            </div>                
          </div> 
     
         </div>

       <%-- <%@ include file="/WEB-INF/include/footer.jsp"%> --%>
       
    </div>

  </div>  


  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/earth-preupload.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  
    <script type="text/javascript">
  
    $("#print").bind('click', function(event) {
      
      var url = "${ctx}/flow/unpayout/print?orderNo="+$("input[name='orderNo']").val();

      window.open(url,'_blank');

    });

  </script>
</body>
</html>
